<!--
 * @Author: Wang WeiHao
 * @Date: 2024-05-07 09:36:05
 * @LastEditors: Wang WeiHao
 * @LastEditTime: 2024-05-07 11:00:13
 * @Description: 
 * @FilePath: \hmcs_map\src\components\project\proSelect.vue
-->
<template>
           <el-select
        v-model="selectValue"
        :style="{width:props.width+'px'}"
        placeholder="Select"
        :size="props.size"
        @change="() => change()"
      >
        <el-option
          v-for="(item) in optionsData"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        />
      </el-select>
</template>
    
<script setup lang='ts'>
import { useOptions } from "@/hook/useOptions";

const props = defineProps({
  optionsData: {
    type: Array<any>,
    default: () => [],
  },
  defaultSelectValue: {
    type: Number,
    default: "",
  },
  width: {
    type: Number,
    default: 100,
  },
  size: {
    type: String,
    default: 'defalut',
  },
});
onMounted(() => {
  console.log(props.optionsData);
});
const emits = defineEmits([
  "update:selectValue",
]);
const change = () => {
  emits("update:selectValue", selectValue.value)
  
};
const selectValue=ref(props.defaultSelectValue)
watch(() => selectValue.value, (newValue, oldValue) => {
  // console.log("selectValue", newValue, oldValue);
});
</script>
    
<style lang="less" scoped>
    
</style>